<?
//header("Content-type: text/html; charset=gbk");
include_once dirname(dirname(__FILE__)).'/include/general.inc.php';
include_once M_ROOT.'./include/common.fun.php';
$mcharset != "utf-8" && $keywords=iconv("utf-8","gbk",$keywords);
!empty($keywords) && $query=$db->query("select a.*,s.* from {$tblprefix}".atbl(4)." a INNER JOIN {$tblprefix}archives_4 s on a.aid=s.aid where chid=4 and (a.subject like '%$keywords%' or s.address like '%$keywords%') AND (leixing=0 OR leixing=2)");
	$result = array();
if(!empty($query)){
	while($row=$db->fetch_array($query)){
		$result[] = array('aid' => $row['aid'], 'subject'=>$row['subject'],'ccid1'=>$row['ccid1'],'ccid2'=>$row['ccid2'],'ccid3'=>$row['ccid3'],'ccid14'=>$row['ccid14'],'address'=>$row['address'],'dt'=>$row['dt']);
	}
}
!empty($keywords) && $query2=$db->query("select a.* from {$tblprefix}arctemp15 a where (a.subject like '%$keywords%' or a.address like '%$keywords%')");
if(!empty($query2)){
	while($row=$db->fetch_array($query2)){
		$result[] = array('aid' => 0, 'subject'=>$row['subject'],'ccid1'=>$row['ccid1'],'ccid2'=>$row['ccid2'],'ccid3'=>'','ccid14'=>'','address'=>$row['address'],'dt'=>$row['dt']);
	}
}
	echo ajax_info($result);	
?>